package com.steak.order.adapter;

import com.steak.common.domain.dataobject.tcc.Order;
import com.steak.common.domain.dto.UpdateOrderDTO;
import com.steak.common.result.Response;
import com.steak.order.execute.OrderExecute;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * @author 刘牌
 * @Title:
 * @date 2022/3/19:50
 */
@RestController
@AllArgsConstructor
@RequestMapping("/order")
public class OrderController {

    private final OrderExecute orderExecute;

    @PostMapping("/saveOrder")
    public Response saveOrder(@RequestBody Order order){
        return orderExecute.execute(order);
    }

    @PostMapping("/updateOrderStatus")
    public Response updateOrderStatus(@RequestBody UpdateOrderDTO updateOrderDTO){
        return orderExecute.updateOrderStatus(updateOrderDTO);
    }

}
